﻿/*********************************************************************************
**                                                                              **
**  Copyright (C) 2024 LiLong                                                   **
**  This file is part of GnssLogs.                                              **
**                                                                              **
**  GnssLogs is free software: you can redistribute it and/or modify            **
**  it under the terms of the GNU Lesser General Public License as published by **
**  the Free Software Foundation, either version 3 of the License, or           **
**  (at your option) any later version.                                         **
**                                                                              **
**  GnssLogs is distributed in the hope that it will be useful,                 **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of              **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               **
**  GNU Lesser General Public License for more details.                         **
**                                                                              **
**  You should have received a copy of the GNU Lesser General Public License    **
**  along with GnssLogs.  If not, see <https://www.gnu.org/licenses/>.          **
**********************************************************************************/
#pragma once

#include "FormatMacro.h"

#include <string>

namespace GnssLogs
{
namespace LogHeader
{
struct Data
{
    enum class TimeStatus
    {
        UNKNOWN            = 20,
        APPROXIMATE        = 60,
        COARSEADJUSTING    = 80,
        COARSE             = 100,
        COARSESTEERING     = 120,
        FREEWHEELING       = 130,
        FINEADJUSTING      = 140,
        FINE               = 160,
        FINEBACKUPSTEERING = 170,
        FINESTEERING       = 180,
        SATTIME            = 200
    };
    std::string sync;
    std::string message;
    uint32_t port;
    int sequence;
    double idleTime;
    TimeStatus timeStatus;
    uint32_t week;
    double seconds;
    uint32_t receiverStatus;
    uint32_t reversed;
    uint32_t receiverSWVersion;
};
} // namespace LogHeader
} // namespace GnssLogs

GNSSLOGS_DECLARE_FORMATTER(GnssLogs::LogHeader::Data)
GNSSLOGS_ENUM_DECLARE_FORMATTER(GnssLogs::LogHeader,
                                Data::TimeStatus,
                                UNKNOWN,
                                APPROXIMATE,
                                COARSEADJUSTING,
                                COARSE,
                                COARSESTEERING,
                                FREEWHEELING,
                                FINEADJUSTING,
                                FINE,
                                FINEBACKUPSTEERING,
                                FINESTEERING,
                                SATTIME)